package com.harmony.pilot.knowledge.repository;

import com.harmony.pilot.knowledge.entity.FuzzerDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Fuzzer详细信息Repository
 */
@Repository
public interface FuzzerDetailRepository extends JpaRepository<FuzzerDetail, Long> {
    
    /**
     * 根据snippet ID查询
     */
    FuzzerDetail findBySnippetId(Long snippetId);
    
    /**
     * 根据目标函数查询
     */
    List<FuzzerDetail> findByTargetFunction(String targetFunction);
    
    /**
     * 根据目标类查询
     */
    List<FuzzerDetail> findByTargetClass(String targetClass);
    
    /**
     * 根据Fuzzer类型查询
     */
    List<FuzzerDetail> findByFuzzerType(String fuzzerType);
    
    /**
     * 查找所有libFuzzer
     */
    default List<FuzzerDetail> findLibFuzzers() {
        return findByFuzzerType("libFuzzer");
    }
}

